import React, { useState, useEffect } from 'react';
import { Tips, TipsButton, TipsButtonText, TipsLine, TipImg, Warp, NoOpen } from './styled';

import { isWeiXin, getPhoneType } from '@/untils'
export default () => {
    //判断是否是微信浏览器
    let [showTips, setShowTips] = useState(isWeiXin())
    // let isIos = getPhoneType() == 'ios';
    useEffect(() => {
        if (showTips) {
            document.body.style.position = "fixed";
            document.body.style.width = "100%";
        }
    }, [showTips])

    // if (isIos) return <Tips >
    //     <NoOpen>iOS App暂未开放哦~</NoOpen>
    // </Tips>

    return <>
        {showTips && <Tips>
            <Warp>
                <TipsLine>
                    <TipImg></TipImg>
                </TipsLine>
                <TipsButton>
                    <TipsButtonText>
                        <div>点击右上角···</div>
                        <div>使用其他浏览器打开</div>
                    </TipsButtonText>
                </TipsButton>
            </Warp>
        </Tips>}
    </>
}